import request from '@/utils/request'

export function fetchList(query) {
    return request({
        url: '/repair/api/maintenance/query/page',
        method: 'get',
        params: query
    })
}
export function fetchBroadInfo(query) {
    return request({
        url: '/device/api/assetField/query/list',
        method: 'get',
        params: query
    })
}
// 保存设备信息
export function saveDeviceInfo(query) {
    return request({
        url: '/repair/api/maintenance/save',
        method: 'post',
        data: query
    })
}
// 更新设备信息
export function updateDeviceInfo(query) {
    return request({
        url: '/repair/api/maintenance/update',
        method: 'put',
        data: query
    })
}
// 维修单详细信息
export function fetchDetailInfo(query) {
    return request({
        url: '/repair/api/maintenance/queryInfo/' + query,
        method: 'get'
    })
}
// 维修单编辑查询信息
export function fetchEditInfo(query) {
    return request({
        url: '/repair/api/maintenance/queryInfo/' + query,
        method: 'get'
    })
}
// 导出
export function exportFile(params) {
    console.log(params)
    return request({
        url: '/device/api/deviceAsset/export',
        method: 'post',
        data: params
    })
}
// 批量导入
export function importFile() {
    return request({
        url: '/device/api/deviceAsset/import',
        method: 'post'
            // data: params
    })
}
// 下载批量导入模板

export function downloadTemplete(query) {
    return request({
        url: '/minio/minio/download/excelTemplate',
        method: 'post'
            // params: query
    })
}
// 删除台账
export function deleteDeviceInfo(query) {
    return request({
        url: '/repair/api/maintenance/deleteById/' + query,
        method: 'delete'
            // data: query
    })
}
// 启用设备
export function useInfo(id) {
    return request({
        url: `/device/api/deviceAsset/start/${id}`,
        method: 'put'
            // data: query
    })
}
// 停用

export function uselessInfo(id) {
    return request({
        url: `/device/api/deviceAsset/stop/${id}`,
        method: 'put'
            // data: query
    })
}
// 档案资料
export function fetchHistoryInfo(id) {
    return request({
        url: `/device/api/assetArchive/query/list/${id}`,
        method: 'get'
            // data: query
    })
}
// 改期
export function changeDate(query) {
    return request({
        url: `/repair/api/maintenance/alterTime`,
        method: 'post',
        data: query
    })
}
//分配
export function allocate(query) {
    return request({
        url: `/repair/api/maintenance/assign`,
        method: 'post',
        data: query
    })
}
//验收
export function checkItem(query) {
    return request({
        url: `/repair/api/maintenance/check`,
        method: 'post',
        data: query
    })
}